Skip to content

Conversation

gustavkj
Copy link
Contributor

@gustavkj gustavkj commented Sep 11, 2025

Closes: #105

Implements auto-detection of soundtrack releases based the title based on a wide range of common title patterns. Supports both common title formats in English (which often are used for releases in other languages as well), German, Swedish, and Norwegian.

I've added test cases for a wide variation of soundtracks.

In contrast to the existing patterns for detecting release group types from the title, the pattern does not always capture the type and as such I had to come up with a way of associating the pattern to a type. I think this can probably be useful for when detecting more release group types from titles in the future.

@gustavkj
Copy link
Contributor Author

gustavkj commented Sep 14, 2025

Sorry, I see the test case failed now. Must have been a last minute change I did, since titles starting and ending with OST or O.S.T. ought to be case sensitive (because Ost is a word in some languages, this would give more false positives than many of the other title formats) and as such now the case in-sensitive test is failing for those cases.

Copy link
Owner

@kellnerd kellnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, that looks promising. I'm not at home right now, so it might take me until next week to review your contributions properly.

@kellnerd kellnerd added the feature New feature or request label Sep 14, 2025
Copy link
Owner

@kellnerd kellnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the general implementation and the large collection of test cases, well done!

My main worry is the additional complexity (and processing time) that we get with each new pattern since these are executed for every release (among them many non-soundtracks).
Currently we try all patterns without exiting early once we have a match. That mostly makes sense for the previously existing patterns where something can be detected as both an EP and Live, for example.
But for the new soundtrack patterns we no longer have to check the remaining ones once we have a match.
So I see a potential to optimize this function by grouping patterns by release type, but you don't have to do that in this PR.

Especially having specific rules for too many languages could be problematic if we are not careful.
I will accept these for now since you have already implemented them (and they are useful for my own selfish needs 😇), but probably won't accept language-specific rules in the future.
My plan is that such rules can be customized client-side later on, as part of the implementation of #130, which will allow us to have disabled rules.

@gustavkj
Copy link
Contributor Author

But for the new soundtrack patterns we no longer have to check the remaining ones once we have a match.
So I see a potential to optimize this function by grouping patterns by release type, but you don't have to do that in this PR.

Might not be what you had in mind, but I added a check in the loop now that skips additional pattern checks if the pattern is for a release type which the release already has been assigned, i.e. if it has already been assigned as a soundtrack no reason to match it against additional soundtrack patterns.

https://github.com/gustavkj/harmony/blob/24a9fbb5a3bc73d24981a598fb4e9739bfbbe3f5/harmonizer/release_types.ts#L58-L61

@kellnerd kellnerd merged commit f7110f7 into kellnerd:main Sep 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-select "Soundtrack" secondary type based on release title
2 participants